1. Field of the Invention
The present invention relates to an apparatus for estimating (or testing) a microcontroller that has a function of executing program estimation such as program debugging, and a function of executing system estimation such as system debugging, and also relates to a method of executing program estimation and system estimation.
More particularly, the present invention relates to an apparatus for estimating a microcontroller, including an estimation device that provides a program development environment for debugging a program (software) of a microcontroller, and also provides a user-generated system estimation environment for debugging a system (hardware) generated by a user, and having a system estimation function capable of tracing arbitrarily an operation of an internal bus in the estimation device. The present invention also relates to a method of estimating a microcontroller for executing debugging of a program and debugging of the user-generated system by using the above-mentioned apparatus.
When the user-generated system is estimated, it is necessary at present to return the system back to the environment in which the program was originally developed using an ICE (In-Circuit Emulator) in order to know under which condition the microcontroller exists. On the other hand, the user is likely to use the ICE when developing software for the microcontroller. To assist and satisfy such a need of the user, an ICE-dedicated device is fabricated.
However, the number of man-hours for developing programs of the microcontroller has been reduced and the number of man-hours for estimating the user-generated system after the development of a system estimation device directed to estimate the user-generated system has been reduced, too. In consequence, a demand has arisen for the reduction of the number of man-hours for fabricating a program estimation device, that is, an ICE-dedicated device. As to the user-generated system itself, on the other hand, there has occurred a requirement for estimating the operation of the microcontroller under the same condition as in the case in which a mass-produced chip having the device assembled therein is mounted.
For these reasons, there has occurred the demand for reconsidering ICE-dedicated devices, that have been developed so far, and estimating the user-generated system by the internal functions of the microcontroller.
2. Description of the Related Art
When the program of the microcontroller and the user-generated system are estimated, it has been customary in the past to estimate the program by using an ICE and an ICE-dedicated device, and to estimate the user-generated system by using the system estimation device that is developed separately from the ICE-dedicated device.
Explanation will be given more concretely. Three kinds of chips, that is, EVA (Evaluation), OTP (One Time Programmable) and MASK (Mask), have been developed so far for microcontrollers.
Among these chips, it is the EVA that can be connected to the ICE and can execute program debugging. The ICE-dedicated device described above is assembled into this chip. The OTP is the chip that is practically mounted to a user board and used for estimating the user-generated system. The system estimation device described above is assembled into this chip. After the user-generated system is estimated, the MASK is developed and mass production of the chips is started.
In recent years, however, the OTP incorporating therein the system estimation device has been replaced by a flash microcontroller in which ROM (Read-Only Memory) and RAM (Random Access Memory)comprise a flash memory. Unlike the OTP which can write the program only once, this flash memory can be rewritten 102 to 105 times. The flash microcontroller containing such a flash memory can easily rewrite the system program, that is, the program for the user-generated system. Therefore, the users are more likely to estimate the system program using the flash microcontroller and then to start as such the mass production of the chips without developing the MASK. In the fields of an HDD (Hard Disk Drive) and portable electronic appliances, for example, the number of users who carry out the mass production of chips by using only the flash microcontroller has increased because an upgrade of a version of the system program is frequently made in such fields.
One of the reasons why such a tendency has occurred is because the price of the flash microcontroller, that was once four to five times the price of the MASK, has dropped down to 1.2 to 1.5 times. This tendency has been accelerated at present in the field in which the tendency of the mass production of the chips of the flash microcontroller type has become wide spread. Therefore, it has become necessary at present to separately develop the EVA, which incorporates the ICE-dedicated device, and the flash microcontroller (inclusive of the ODP) which incorporates the system estimation device.
The program development cycles of users have become faster and the program has become fixed within a shorter time in recent years with the result that the estimation schedule of the user-generated system tends to become shorter. Because the number of man-hours for the system estimation device must thus be decreased, it has become more difficult to set the number of man-hours of development of the system estimation device independently of the number of man-hours of the ICE-dedicated device. Furthermore, because the user-generated system has become more complicated, the limit to the estimation of the user-generated system using the system estimation device has become more apparent. It has thus become indispensable to develop a device that can satisfy fully the condition of the program estimation and the condition of the user-generated system estimation.
Namely, even when the microcontroller is estimated by the methods described above, the sum of (number of man-hours of program development+number of man-hours of development of device designed exclusively for ICE) does not match with the sum of xe2x80x9cnumber of man-hours of development of ICE-dedicated devicexe2x80x9d and xe2x80x9cnumber of man-hours of development of system estimation devicexe2x80x9d. Thus, means for providing an environment for estimating quickly and efficiently the user-generated system has become necessary. It has become also necessary to provide an estimation environment of the user-generated system that can cope with complication of the user-generated system.
In order to clarify the problems of the estimation system of the microcontroller according to the prior art, that has been devised to eliminate the disadvantages described above, the construction of the estimation device used conventionally for estimating the microcontroller, and the estimation system of the microcontroller using this estimation device, will be explained with reference to FIGS. 1 and 2 of the later-appearing xe2x80x9cBRIEF DESCRIPTION OF THE DRAWINGSxe2x80x9d
FIG. 1 shows the construction of the estimation device used conventionally for estimating the microcontroller. As shown in FIG. 1, this estimation device (that is, the ICE-dedicated device) 100 incorporates therein a tool interface (that is, ICE interface 104) having an interface function with an ICE 90 (see FIG. 2), a CPU (Central Processing Unit) for debugging a program, a peripheral circuit. 107 for processing the control signal sent from the tool interface, a built-in RAM 103 for temporarily storing the program sent from the ICE 90, and a bus monitoring unit 107 for monitoring the state of an internal bus 160.
After the ICE-dedicated device 100 is connected to the ICE 900 through the tool interface 104, it is connected to the system estimation board, etc., through the probe cable (for example, the later-appearing target probe 102 in FIG. 2). In this way, program debugging and estimation of the user-generated system are executed.
Explanation is given hereby in further detail. In the prior art apparatuses, the ICE-dedicated tool interface 104 is built in the device, and the program outputted from the memory connected to the ICE 90 is loaded from the program loader 109 to the bus control unit 108. He bus monitoring unit 105 monitors the state of the internal bus 160, and emulation is executed by the ICE through the tool interface 104.
The ICE-dedicated device 100 does not have the built-in rewritable program ROM. Therefore, the function unit A containing the tool interface 104 and the bus control unit 108 is regarded virtually as the program memory and the program portion that is desired to be rewritten is loaded to the program memory from the ICE 90 through the tool interface 104. Monitoring of the internal bus 160 is effected at this time so that the program can be estimated.
A block diagram showing the estimation system of the conventional microcontroller using the ICE-dedicated device 100 shown in FIG. 1, is illustrated in FIG. 2. However, the construction of the conventional estimation system of the microcontroller is shown in a simplified form for simplifying the explanation.
FIG. 2 shows concretely the mounting position of the ICE-dedicated device 100 and its role when this device 100 is used for system estimation. Here, the program that is programmed by a personal computer 98 is loaded to the ICE-dedicated device 100 from the ICE 90 through the tool interface 104. The ICE-dedicated device 100 is mounted to a system estimation device mounting portion 110 of the system estimation board 92-2. An operation signal is supplied to the system estimation board 92-2. Whether or not the system estimation board operates normally at this time can be easily determined by monitoring the state of the internal bus 160 of the ICE-dedicated device 100. Therefore, the information on the state of the internal bus 160 is converted to the form that can be grasped by the personal computer 98, and debugging of the program is executed by this personal computer 98.
An explanation will be given in further detail. In the conventional estimation system of the microcontroller shown in FIG. 2, the ICE-dedicated device 100 for constituting the microcontroller contains, as built-in devices, the tool interface 104 having the interface function with the. ICE 90 and the target probe 102 for converting the form of the signals supplied from the ICE 90. The signals supplied from the ICE 90 contain the control signal Sic for controlling the CPU 106 inside the ICE-dedicated device, 100 and the address/data signals Sia relating to the program offered by the ICE 90. These control signal Sic and address/data signals Sia are processed by the tool interface 104 and are then transferred to the CPU 106 and to the target probe 102.
The tool interface 104 is generally equipped with a peripheral function for processing the signals of the serial form and the signals of the parallel form, and can process the signals of an arbitrary form supplied from the ICE 90 by this peripheral function. On the other hand, the target probe 102 is typically equipped with a number of jumper lines for signal transfer. After the form of the address/data signals Sia from the ICE 90 is converted by the target probe 102, these signals are sent to the system estimation device mounting portion 110 of the system estimation board (which is also called the xe2x80x9ctarget boardxe2x80x9d) 92-2 through the jumper lines.
In the construction shown in FIG. 2, the CPU 106 inside the ICE-dedicated device 100 is allowed to execute debugging of the program by operating the program of the ICE 90 while the ICE-dedicated device 160 is mounted to the program estimation board 92-1. At the same time, the program of the ICE 90 is sent to the system estimation device mounting portion 110 through the target probe 102 so as to create the same state as the state where the system estimation device is practically mounted to the system estimation board 92-2. In this way, the user-generated system can be estimated by using only the ICE-dedicated device.
As described above, in the conventional estimation system of the microcontroller shown in FIGS. 1 and 2, the target probe is provided to the ICE-dedicated device, that has been directed mainly for debugging of the program, in order to cope with the program development and user-generated system estimation within a shorter time, and user-generated system estimation is executed in a simple way by using the ICE-dedicated device furnished with the target probe.
According to such a construction, however, the signal for program estimation from the ICE is supplied to the system estimation board through the target probe. Therefore, the possibility that user-generated system estimation cannot be executed correctly occurs because an AC (Advanced Communication) standard imparted to the signals, to be transferred is likely to vary. Therefore, the problem remains unsolved in that user-generated system estimation becomes again necessary by mounting the system estimation device to the system estimation board.
On the other hand, the user-generated system has become so complicated that program defects (e.g., branch conditions) cannot be grasped even when the system estimation device is employed. In consequence, it takes a lot of labor and time to discover the bugs in the software from the outside of the system estimation device, and user-generated system estimation using the system estimation device is likely to impede the efficient development of the user-generated system.
In view of the problems described above, it is an object of the present invention to provide an apparatus for estimating a microcontroller that can develop a program estimation device and a system estimation device within a short time and can execute easily and efficiently user-generated system estimation, and an estimation method thereof.
To accomplish this object, an apparatus for estimating a microcontroller according to the present invention comprises, in one device, a data holding unit for holding arbitrary data rewritably; a processing unit for processing the arbitrary data by operating a microcontroller on the basis of a control signal; an interface unit for external communication, for receiving signals supplied from the external (e.g., an external device), taking out the control signal and sending it to the processing unit; and an internal bus monitoring unit for monitoring the state of an internal bus for mutually connecting the data holding unit, the processing unit and the interface unit for external communication.
Here, the processing unit has a construction such that it writes the state of the internal bus, at the time when the microcontroller is operated on the basis of the control signal, into the internal bus monitoring unit, and inputs the data written into this internal bus monitoring unit to the data holding unit or sends the data to the external.
Preferably, in the apparatus for estimating the microcontroller according to the present invention, the interface unit for external communication has a serial/parallel interface circuit containing a serial interface for processing signals of a serial form and a parallel interface for processing signals of a parallel form.
The terminals of each of the serial interface and the parallel interface in the serial/parallel interface circuit can function also as the terminals for handling the signals used for general-purpose ports. When the terminals of each of the serial interface and the parallel interface in the parallel/serial interface circuit function also as the terminals for handling the input/output signals other than the signals used for the general-purpose ports, these terminals can be switched to the terminals for handling the input/output signals other than the signals used for the general-purpose port during the period in which the serial interface and the parallel interface are used.
On the other hand, an apparatus for estimating a microcontroller according to the present invention comprises, in a first device, a first data holding unit for holding arbitrary data rewritably; a first processing unit for processing the arbitrary data by operating a microcontroller on the basis of a first control signal; a first interface unit for external communication, for receiving signals supplied from the external, taking out the first control signal, and sending it to the first processing unit; and a first internal bus monitoring unit for monitoring the state of a first internal bus for mutually connecting the first data holding unit, the first processing unit and the first interface unit for external communication. Furthermore, the estimation apparatus comprises, in a second device, a second data holding unit for holding arbitrary data rewritably; a second processing unit for processing the arbitrary data by operating the microcontroller on the basis of a second control signal; a second interface unit for external communication, for receiving the signals from the first interface unit for external communication, taking out the second control signal and sending it to the second processing unit; and a second internal bus monitoring unit for monitoring the state of a second internal bus for mutually connecting the second data holding unit, the second processing unit and the second interface unit for external communication.
Program estimation of the microcontroller is executed in the following way in the estimation apparatus of the microcontroller having the construction described above. The first device and the second device are connected through the first and second interface units for external communication. The first processing unit in the first device transfers the signals supplied from outside to the second interface unit for external communication through the first interface unit for external communication. The second processing unit in the second device writes the state of the second internal bus at the time when the program for program estimation, that is contained in the signals transferred to the second interface unit for external communication, is operated, into the second internal bus monitoring unit, and inputs the data written into the second internal bus monitoring unit, to the first internal bus monitoring unit or the first data holding unit through the second and first interface units for external communication, or sends it to the external. When system estimation of the microcontroller is executed, the first device is cut off from the second device, and the second processing unit in the second device writes the state of the second internal bus, at the time when the program for system estimation, that is contained in the signals written into the second data holding unit, is operated, is written into the second internal bus monitoring unit through the second interface unit for external communication, and reads out the data written into the second internal bus monitoring unit from the second interface unit for external communication.
Incidentally, when the first and second devices are fabricated by the same fabrication process, these devices can be accomplished by the same chip.
In the estimation apparatus of the microcontroller according to the present invention, the first interface unit for external communication includes a first serial interface for processing the signals of the serial form and a first parallel interface for processing the signals of the parallel form, and the second interface unit for external communication includes a second serial interface for processing the signals of the serial form and a second parallel interface for processing the signals of the parallel form. When program estimation of the microcontroller is executed in the estimation apparatus of the microcontroller having such a construction, the first and second devices are connected through the first and second serial interfaces, and the signals supplied from the external are inputted to the first parallel interface and are then transferred to the second serial interface through the first serial interface.
The first data holding unit preferably comprises a first ROM which is capable of electrically rewriting the data and the second data holding unit preferably comprises a second ROM which is capable of electrically rewriting the data.
Preferably, the estimation apparatus includes, in the first device, a first on-board write interface having a function of rewriting the content of the data in the first ROM while the first device is mounted to a first board, and includes, in the second device, a second on-board write interface having a function of rewriting the content of the data inside the second ROM while the second device is mounted to a second board.
On the other hand, when a data holding unit for holding rewritably arbitrary data, a processing unit for processing the arbitrary data by operating a microcontroller, an interface unit for external communication, for receiving signals supplied from the external and processing them and an internal bus monitoring unit for monitoring the state of an internal bus are assembled in one device, a method of estimating a microcontroller according to the present invention comprises the steps of writing the state of the internal bus, at the time when the microcontroller is operated on the basis of the control signal taken out from the signals supplied from the external, into the internal bus monitoring unit, and inputting the data written into the internal bus monitoring unit to the data holding unit, or sends it to the external.
On the other hand, when a first data holding unit for holding arbitrary data rewritably, a first processing unit for processing the arbitrary data by operating a microcontroller, a first interface unit for external communication, for receiving signals supplied from the external and a first internal bus monitoring unit for monitoring the state of a first internal bus are assembled in a first device and when a second data holding unit for holding arbitrary data rewritably, a second processing unit for processing the arbitrary data by operating the microcontroller, a second interface unit for receiving and processing the signals supplied from the external and a second internal bus monitoring unit for monitoring the state of a second internal bus are assembled in a second device, a method of estimating a microcontroller according to the present invention, when it executes program estimation of the microcontroller, comprises the steps of transferring the signals supplied from the external to the second interface unit for external communication through the first interface unit for external communication in the first device, writing, in the second device, the state of the second internal bus at the time when a program for program estimation, that is contained in the signals transferred to the second interface unit for external communication, into the second internal bus monitoring unit, and inputting the data written into the second internal bus monitoring unit to the first internal bus monitoring unit or the first data holding unit in the first device through the second and first interface units for external communication, or sending the data to the external, and comprises, when system estimation of the microcontroller is executed, the steps of cutting off the first device from the second device, writing, in the second device, the state of the second internal bus at the time when a program for system estimation, that is contained in the signals written into the second data holding unit, into the second internal bus monitoring unit through the second interface unit for external communication, and reading out the data written into the second internal bus monitoring unit from the second interface unit for external communication.
The estimation apparatus of the microcontroller and the estimation method thereof according to the present invention can easily execute program estimation and system estimation while the program estimation device and the system estimation device are mounted to the board of the user-generated system. Therefore, the program estimation device and the system estimation device need not be developed separately, but can be developed within a short time. In this case, both the program estimation device and the system estimation device can be accomplished by developing only one kind of the device. Therefore, the users can make timely system design, and the TAT (Turnaround time also called the xe2x80x9cnumber of man-hours for system developmentxe2x80x9d) can be reduced remarkably. In other words, the present invention can sufficiently satisfy the user""s requirement for the reduction of the system design time as well as the device development. When program estimation and system estimation are executed using one kind of the devices described above, the installation cost can be reduced because the probe cable is not used.
The estimation apparatus of the microcontroller and the estimation method thereof according to the present invention can efficiently execute program estimation and user-generated system estimation in the same environment as when the mass-produced devices are mounted to the board of the system. Therefore, the shift from the program development and the system development to the mass production of the devices can be made smoothly.
More concretely, the estimation apparatus of the microcontroller and the estimation method thereof according to the present invention use one chip in place of the EVA and the flash microcontroller (inclusive of the OTP), and make it possible to improve the TAT for the development and to start immediately the mass production by using one-chip microcontroller constituted by this one chip. In a practical construction, connection with the ICE becomes possible by using two one-chip microcontrollers, and the microcontroller can be used as the flash microcontroller whose mass production can be conducted readily by using one one-chip microcontroller. In consequence, the present invention can accomplish the functions of two or three kinds of chips according to the prior art by developing one kind of chips.